<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>AdminLTE 2 | General Form Elements</title>
        <!-- Tell the browser to be responsive to screen width -->
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <!-- Bootstrap 3.3.6 -->
        <link rel="stylesheet" href="/Public/ui/framework/bootstrap-3.3.7-dist/css/bootstrap.min.css">
        <!-- Font Awesome -->
        <link rel="stylesheet" href="/Public/ui/fonts/Font-Awesome-4.7.0/css/font-awesome.min.css">
        <!-- Ionicons -->
        <link rel="stylesheet" href="/Public/ui/fonts/ionicons-2.0.1/css/ionicons.min.css">
        <!-- Theme style -->
        <link rel="stylesheet" href="/Public/ui/adminlte/css/AdminLTE.min.css">
        <!-- AdminLTE Skins. Choose a skin from the css/skins
             folder instead of downloading all of them to reduce the load. -->
        <link rel="stylesheet" href="/Public/ui/adminlte/css/skins/_all-skins.min.css">
        <link rel="stylesheet" href="/Public/ui/plugins/datetimelib/bootstrap-datetimepicker-2.4.3/css/bootstrap-datetimepicker.min.css" />
        
    </head>
    <body class="hold-transition skin-blue">
        <!-- Horizontal Form -->
        <div class="box box-primary" style="box-shadow: none;">
            <!-- /.box-header -->
            <!-- form start -->
            
<!-- form start -->
<form class="form-horizontal" action="<?php echo U('editSave');?>" method="post">
    <div class="box-body">
        <div class="form-group">
            <label class="col-sm-2 control-label">类别名称</label>
            <div class="col-sm-10">
                <input type="text" name="title" class="form-control input-sm" placeholder="类别名称" required="required" value="<?php echo ($data["title"]); ?>" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">类别代码</label>
            <div class="col-sm-10">
                <input type="text" name="code" class="form-control input-sm" placeholder="类别代码" value="<?php echo ($data["code"]); ?>" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">上级类别</label>
            <div class="col-sm-10">
                <select name="pid" data-url="<?php echo U('getTreeJson');?>" data-value="<?php echo ($data["pid"]); ?>"></select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">备注信息</label>
            <div class="col-sm-10">
                <input type="text" name="remark" class="form-control input-sm"  placeholder="备注信息" size="79" value="<?php echo ($data["remark"]); ?>" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">状态</label>
            <div class="col-sm-10">
                <?php $radioVal_status=(isset($data['status']) && ($data['status'] !== ""))?($data['status']):'1';$radios_status=array("1"=>"启用","0"=>"禁用");foreach($radios_status as $v=>$t):echo '<label class="radio-inline"><input type="radio" name="status" value="',$v,'"',((''!=$radioVal_status && $radioVal_status==$v)?' checked="checked"':''),'> ',$t,'</label>';endforeach;?>
            </div>
        </div>
    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <input type="hidden" name="id" value="<?php echo ($data["id"]); ?>" />
        <button type="button" class="btn btn-default xsui-btn-close-dialog">取消</button>
        <button type="submit" class="btn btn-primary pull-right">保存</button>
    </div>
    <!-- /.box-footer -->
</form>

        </div>
        <!-- /.box -->
        <!-- /.content -->

        <!-- jQuery 2.2.3 -->
        <script src="/Public/ui/plugins/jquery/jquery-2.2.3.min.js"></script>
        <!-- Bootstrap 3.3.6 -->
        <script src="/Public/ui/framework/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
        <!-- Layer 3.0.1 -->
        <script src="/Public/ui/plugins/dialoglib/layer-v3.0.1/layer.js"></script>
        <!-- AdminLTE App -->
        <script src="/Public/ui/adminlte/js/app.min.js"></script>
        <script src="/Public/ui/plugins/datetimelib/bootstrap-datetimepicker-2.4.3/js/bootstrap-datetimepicker.min.js"></script>
        <script src="/Public/ui/plugins/datetimelib/bootstrap-datetimepicker-2.4.3/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
        <script src="/Public/ui/plugins/editorlib/kindeditor-4.1.11/kindeditor-all-min.js"></script>
        <script src="/Public/theme/public/plugins/ajax-combobox-1.0/ajax-combobox-1.0.js"></script>
        <script src="/Public/theme/public/plugins/jquery-ajaxcombobox-1.0/jquery-ajaxcombobox-1.0.js"></script>
        <script src="/Public/ui/adminlte/js/xsApp.js"></script>
        
        
<script>
    $('select[name="pid"]').ajaxcombobox({first: {id: "", text: "选择上级类别"}});
</script>

        
        <script>
            $(document).ready(function () {
                xsApp.initDialogForm();
            })
            /**
             * 单文件上传回调函数
             * @param {type} name
             * @param {type} value
             * @returns {undefined}
             * @version 1.0 2016-12-15
             */
            function single_uploader_cb(name, value) {
                var $input = $('[name="' + name + '"]');
                $input.val(value)
                //$input.parent().parent().find('img').attr('src', value).parent().attr({'href': value, 'title': value}).next().data('url', value);
                layer.closeAll();
                //$('iframe').parent().dialog('close');
            }
            /**
             * 批量文件上传回调函数
             * @param {type} name
             * @param {type} value
             * @returns {undefined}
             * @version 1.0 2016-12-15
             */
            function multi_uploader_cb(name, value) {
                var $input = $('[name="' + name + '"]');
                var str = $input.val();
                if (str.length > 0) {
                    str += '|';
                }
                str += value;
                $input.val(str);
                $('iframe').parent().dialog('close');
            }
        </script>
        
        
    </body>
</html>